package com.example.zhc36.fragment;

import android.content.Intent;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.widget.TextView;

import com.example.zhc36.fragment.apadter.Rvnewmoreadapter;
import com.example.zhc36.fragment.bean.Featurebean;
import com.example.zhc36.fragment.dao.FeatureDao;
import com.example.zhc36.fragment.utils.app.BaseActivity;

import java.util.List;

public class MainmoreFragment extends BaseActivity implements View.OnClickListener {
    private RecyclerView rlv;
    private TextView t2;


    @Override
    protected int getLayoutId() {
        return R.layout.activity_more_main;


    }

    @Override
    protected void initView() {
        rlv = findViewById(R.id.rlv);
        t2 = findViewById(R.id.tvo2);


    }

    @Override
    protected void initData() {
        FeatureDao dao = new FeatureDao();
        List<Featurebean> close = dao.findAllClose();
        List<Featurebean> open = dao.findshow();
        Rvnewmoreadapter more = new Rvnewmoreadapter(close, open);
        rlv.setLayoutManager(new LinearLayoutManager(act));
        rlv.setAdapter(more);



    }

    @Override
    protected void initListener() {
        t2.setOnClickListener(this);


    }

    @Override
    public void onClick(View view) {
            this.finish();
         Intent it=new Intent(this,MainActivity.class);
         it.putExtra("name",R.id.dt);
         startActivity(it);


    }
}
